Skip to content

Batch animation reads and writes to avoid layout thrash#249

Merged
amjadr360 merged 2 commits into
mainfrom
fix-animations-layout-thrash-lcp
Jun 15, 2026
Merged

Batch animation reads and writes to avoid layout thrash#249
amjadr360 merged 2 commits into
mainfrom
fix-animations-layout-thrash-lcp

Conversation

@amjadr360

@amjadr360 amjadr360 commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Issue: https://extendify.slack.com/archives/C07S030UWSJ/p1780329470747489

Refactors the animation reveal script to batch DOM reads and writes so the browser lays out once instead of once per element. Previously it measured each element's position right after changing its styles, which forces a reflow on every animated element.

Behavior is unchanged — same animations, same reveal timing.

Batch animation reads and writes so the browser lays out once instead of once per element (removes layout thrash in the reveal path).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@amjadr360 amjadr360 force-pushed the fix-animations-layout-thrash-lcp branch from 0a3cd32 to 03bf12b Compare June 7, 2026 23:59
@amjadr360 amjadr360 marked this pull request as ready for review June 8, 2026 00:04
@kossmann

Copy link
Copy Markdown
Contributor

@amjadr360 how should I test test and what should I be looking for to know that this is working as expected?

@amjadr360

Copy link
Copy Markdown
Contributor Author

@amjadr360 how should I test test and what should I be looking for to know that this is working as expected?

Since this only refactors the code, no behavior is changed — just checking if the animation is working.

@amjadr360 amjadr360 merged commit 99a3f42 into main Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants